package c2.group.business.teampvp.sub;

import c2.group.business.base.GroupSubModule;
import c2.group.business.teampvp.TeamPvpModule;
import cate.game.pvp.teampvp.TeamPvpMsg;
import cate.game.pvp.teampvp.dto.TeamPvpReportData;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TeamPvpMsgModule extends GroupSubModule<TeamPvpModule> {
    public void sendReport(int srvId, TeamPvpReportData data) {
        try {
            log.info("开始发送给游戏服战报，srv={}, role={}", srvId, data.uid);
            useRpcSend().fireAndForgetGameTemplate(TeamPvpMsg.REPORT_NOTICE,
                    srvId,
                    data);
        } catch (Exception e) {
            log.error("发送剧本失败", e);
        }
    }

    public void sendTeam(int srvId, String uid) {
        try {
            useRpcSend().fireAndForgetGameTemplate(TeamPvpMsg.TEAM_NOTICE,
                    srvId,
                    uid);
        } catch (Exception e) {
            log.error("发送组队信息失败", e);
        }
    }

    public void sendRedPoint(int srvId, String uid) {
        try {
            useRpcSend().fireAndForgetGameTemplate(TeamPvpMsg.RED_POINT,
                    srvId,
                    uid);
        } catch (Exception e) {
            log.error("发送红点消息失败", e);
        }
    }
}
